package org.wsff.tools.api.gateway.core.monitor;

import java.io.Serializable;

import org.wsff.tools.api.gateway.core.GatewayContext;

/**
 * 网关监控上下文接口
 *
 * @author ryan
 * @version Id: MonitorGatewayContext.java, v 0.1 2022-02-08 14:00 ryan Exp $$
 */
public interface MonitorGatewayContext<Request extends Serializable, Response extends Serializable> extends GatewayContext<Request, Response> {

    /**
     * set proxy response code & message.
     *
     * @param code code
     * @param message message
     */
    void setResponse(String code, String message);

    /**
     * get reqTime
     *
     * @return reqTime
     */
    long reqTime();

    /**
     * get respTime
     *
     * @return respTime
     */
    long respTime();

    /**
     * Gets the value of code.
     *
     * @return the value of code
     */
    String code();

    /**
     * Gets the value of message.
     *
     * @return the value of message
     */
    String message();

    /**
     * 开始监控
     */
    void start();

    /**
     * 结束监控
     */
    void stop();
}
